Deavmi's coding shack
Commit c4ea2b3e596bc76539d291833e721e70189a950c
Parents : e9414ff
Author : Tristan B. Kildaire <deavmi@redxen.eu>
Date : 2021-05-31T16:29:19+02:00
Updated code examples infratsructure
Changes
3 files changed, 44 insertions(+), 1 deletions(-)
Diff
diff --git a/new_docs/content/documentation/examples/_index.md b/new_docs/content/documentation/examples/_index.md
index 9953744..43bdbeb 100644
--- a/new_docs/content/documentation/examples/_index.md
+++ b/new_docs/content/documentation/examples/_index.md
@@ -4,3 +4,4 @@ title: Code examples
This page holds an assortment of code exampls that have been or are being used to test the compiler during development, it's also helpful to give you an idea as to what the syntax is since so far it hasn't been documented in a formal manner (either written out with explanations or via a grammar).
+[How this page is generated](how/)
\ No newline at end of file
diff --git a/new_docs/content/documentation/examples/how.md b/new_docs/content/documentation/examples/how.md
new file mode 100644
index 0000000..8c12b54
--- /dev/null
+++ b/new_docs/content/documentation/examples/how.md
@@ -0,0 +1,40 @@
+---
+title: Code example page generation
+---
+
+The code examples page is generated via the following script (and then Hugo simply takes the `.md` files and builds them into the website).
+
+This page is made with the following script:
+
+```bash
+# Delete everything (except index page)
+mv _index.md bruh
+rm *.md
+mv bruh _index.md
+
+rm -rf tFiles
+
+# Fetch current testing files
+mkdir tFiles
+cd tFiles
+wget --mirror http://deavmi.assigned.network/projects/tdists/May/a1c6eb9c748fc8836140329f2bc63bd03a282d2a/src/source/tlang/testing/ -l 1 -nd
+cd ..
+
+p=0
+
+for i in $(ls tFiles)
+do
+ # Output filename
+ file="$p.md"
+ echo "---" > "$file"
+ echo "title: $i" >> "$file"
+ echo "tags: [codeExample]" >> "$file"
+ echo -e "---\n" >> "$file"
+ echo -e "# Example: \`$i\`\n" >> "$file"
+ echo -e "\`\`\`d" >> "$file"
+ cat "tFiles/$i" >> "$file"
+ echo -e "\`\`\`" >> "$file"
+
+ p=$(($p+1))
+done
+```
\ No newline at end of file
diff --git a/new_docs/content/documentation/examples/makeDocs.sh b/new_docs/content/documentation/examples/makeDocs.sh
index b9d6178..f256766 100644
--- a/new_docs/content/documentation/examples/makeDocs.sh
+++ b/new_docs/content/documentation/examples/makeDocs.sh
@@ -1,7 +1,9 @@
-# Delete everything (except index page)
+# Delete everything (except index page and generationScript page)
mv _index.md bruh
+mv how.md bruh2
rm *.md
mv bruh _index.md
+mv bruh2 how.md
rm -rf tFiles
Served by rngit 1.5.0 - Generated in 0.13s